package cn.scu.ne04jdemo.controller;

import cn.scu.ne04jdemo.entitiy.ScheOrderInfoEntity;
import cn.scu.ne04jdemo.entitiy.ScheTaskDevInfoEntity;
import cn.scu.ne04jdemo.entitiy.ScheTaskDevMatchInfoEntity;
import cn.scu.ne04jdemo.service.ScheTaskDevInfoService;
import cn.scu.ne04jdemo.service.ScheTaskDevMatchInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sche/task/dev/match")
public class ScheTaskDevMatchInfoController {

    @Autowired
    private ScheTaskDevMatchInfoService scheTaskDevMatchInfoService;

    @GetMapping("/findPage")
    public ResponseEntity<IPage> findPage(@RequestParam(required = false) String orderName,
                                          @RequestParam(required = false) String taskName,
                                          @RequestParam(defaultValue = "1") int pageNum,
                                          @RequestParam(defaultValue = "10") int pageSize) {
        IPage<ScheTaskDevMatchInfoEntity> page = scheTaskDevMatchInfoService.findPage(new Page<>(pageNum, pageSize), orderName, taskName);
        return ResponseEntity.ok(page);
    }
}
